package com.firewolf.rabbitmq.service;

import org.springframework.amqp.rabbit.core.RabbitTemplate;

public class MessageServiceImpl implements MessageService{
	
	
	private RabbitTemplate rabbitMQTemplate;

	@Override
	public void sendMessage(String msg) {
		//发送消息，指定路由键
		rabbitMQTemplate.convertAndSend("black",msg);
	}

	public RabbitTemplate getRabbitMQTemplate() {
		return rabbitMQTemplate;
	}
	public void setRabbitMQTemplate(RabbitTemplate rabbitMQTemplate) {
		this.rabbitMQTemplate = rabbitMQTemplate;
	}
}
